home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / action_fishing.swf / scripts / frame_19 / PlaceObject2_168_15 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-01-13  |  1KB  |  52 lines

  1. onClipEvent(enterFrame){
  2.    function reiniciar()
  3.    {
  4.       gotoAndStop(1);
  5.       direccion = random(2) + 1;
  6.       if(direccion == 1)
  7.       {
  8.          this._x = random(4200) + 500;
  9.          sentido = 1;
  10.       }
  11.       if(direccion == 2)
  12.       {
  13.          this._x = - random(4200);
  14.          sentido = -1;
  15.       }
  16.       this._rotation = 0;
  17.       pesco = false;
  18.       this._y = random(130) + 210;
  19.    }
  20.    if(_root.pausa == false)
  21.    {
  22.       if(_root.tiempo <= 0)
  23.       {
  24.          this.unloadMovie();
  25.       }
  26.       this._x -= velocidad * sentido;
  27.       if(this.hitTest(_root.tipo.raya.anzuelo) && _root.tipo.raya._currentframe > 15 && pesco == false)
  28.       {
  29.          pesco = true;
  30.          gotoAndPlay(2);
  31.          if(_root.tiempo > 80)
  32.          {
  33.             _root.mctiempo.vtiempo = 100;
  34.             _root.time.timee.mctime._x = 460 + _root.time.timee.mctime._width / 2;
  35.          }
  36.          else
  37.          {
  38.             _root.mctiempo.vtiempo += 20;
  39.             _root.time.timee.mctime._x -= 40;
  40.          }
  41.       }
  42.       if(this._x < -100 and direccion == 1)
  43.       {
  44.          reiniciar();
  45.       }
  46.       if(this._x > 800 and direccion == 2)
  47.       {
  48.          reiniciar();
  49.       }
  50.    }
  51. }
  52.